import { Component } from '@angular/core';
import { ZwpzService } from '../server/zwpz.service';

import{Router} from '@angular/router'


@Component({
  selector: 'app-tab2',
  templateUrl: 'tab2.page.html',
  styleUrls: ['tab2.page.scss']
})
export class Tab2Page {
  
  private title:string = '梦红楼';
  private welcomeStr:string;

  private list:any;

  constructor(private zwpzk:ZwpzService,private router:Router) {
    this.welcomeStr = '欢迎来到梦红楼';
    this.initData();
  }

  initData(){
    this.zwpzk.getFreePlay().subscribe(res=>{
      this.list = res.data;
      console.log(res.data);
    })
  }

  edit(i){
    this.router.navigate(['/tabs/tab3'],{
      
      queryParams:{
        id:i
        
      }
    });
  }

  

}
